package com.jinlejia.bbs.ui.fun;

import android.content.Intent;
import androidx.databinding.DataBindingUtil;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.jinlejia.bbs.R;
import com.jinlejia.bbs.databinding.BbsActivityInvitedToAnswerBinding;
import com.jinlejia.bbs.help.CommonEvent;
import com.jinlejia.bbs.ui.mine.BBSSearchAnswerActiviy;

//邀请回答
public class BBSInvitedToAnswerActivity extends AppCompatActivity {
    private BbsActivityInvitedToAnswerBinding binding;
    private String topicCode;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.bbs_activity_invited_to_answer);
        binding.setCommonEvent(CommonEvent.obtain());
        binding.setEvent(this);
        topicCode = getIntent().getStringExtra("topicCode");
    }

    public void toBBSChooseTagActivity(View view){
        Intent intent = new Intent();
        intent.setClass(this,BBSChooseTagActivity.class);
        intent.putExtra("save",false);
        intent.putExtra("ignore",false);
        startActivityForResult(intent,10);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode==RESULT_OK){
            Intent intent = new Intent();
            intent.putExtra("tag",data.getStringExtra("data"));
            intent.putExtra("topicCode",topicCode);
            intent.setClass(this,BBSInvitedUserListActivity.class);
            startActivity(intent);
        }
    }

    public void answer(View view){
        Intent intent = new Intent();
        intent.putExtra("topicCode",topicCode);
        intent.setClass(this,BBSSearchAnswerActiviy.class);
        this.startActivity(intent);
    }
}
